package com.ocom.webapi.controller;

import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.redis.util.RedisUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description: 德生科技
 **/
@RestController
public class TestController {

    @Resource
    private RedisUtil redisUtil;

    @GetMapping("/test99")
    public Result subAccountSet() {
//        String date = DateUtils.getStrDate(new Date(),"yyyyMMddHH") ;
        String faceErrKey ="FaceErr:" + 52+":" + "23100102" + ":" + "2025091209";

        for (int i=0;i<200;i++){
            redisUtil.hmSet(faceErrKey, i, i);
        }

        faceErrKey ="FaceErr:" + 52+":" + "23100102" + ":" + "2025091208";

        for (int i=0;i<100;i++){
            redisUtil.hmSet(faceErrKey, i, i);
        }

        faceErrKey ="FaceErr:" + 52+":" + "23100102" + ":" + "2025091207";

        for (int i=0;i<500;i++){
            redisUtil.hmSet(faceErrKey, i, i);
        }

//        redisUtil.hmSet(faceErrKey,1,1);
//        redisUtil.hmSet(faceErrKey,2,2);
//        redisUtil.hmSet(faceErrKey,3,3);

        System.out.println(redisUtil.hmLen(faceErrKey)); ;

        List<Map.Entry<String, String>> originalCursor = redisUtil.hmScan(faceErrKey);

        return ResultUtil.success(originalCursor);
    }
}
